<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of genReporte
 *
 * @author mini
 */
class Metricas extends CI_Controller {

    public function __construct() {
        parent::__construct();
        global $admin, $data;
        #Cargamos datos del administrador
        $admin = $this->session->userdata('admin');
        $this->verificacion_acceso($admin);
        $admin['place'] = 'metricas';
        $this->output->enable_profiler(FALSE);
    }

    public function index() {
        global $admin, $data;

        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/content');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }

    
    public function genRepPromXE(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->promXE();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/promxe');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function geRepPromXD(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->promXD();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/promxd');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function genRepPromXM(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->promXM();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/promxm');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function genRepPromXSM(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->promXSM();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/promxsm');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function genReptPersonasXE(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->tpersonasXE();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/tpersonasxe');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function genReptPersonasXD(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->tpersonasXD();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/tpersonasxd');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
        
    }
     
    public function getReptPersonasXM(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->tpersonasXM();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/tpersonasxm');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function getReptpersonasXSM(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->tpersonasXSM();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/tpersonasxsm');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    
    public function getReptPersonasXMaterial(){
        global $admin, $data;
        
        $data['lista'] = $this->cc_model_a->tpersonasXMaterial();
        
        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_admin', $data);
        $this->load->view('genReporte/metricas/tpersonasxmaterial');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }
    /**
     * Funcion que se encarga de verificar que 
     * se logueara antes
     */
    public function verificacion_acceso($admin) {
        if ($admin['ta_tipo_administrador_id'] != 1) {
            redirect('home');
        }
    }
}
